package com.itheima.test.blockingqueue;

import java.util.concurrent.ArrayBlockingQueue;

public class Demo01 {//使用堵塞队列实现等待唤醒机制
    public static void main(String[] args) {
        //创建堵塞队列
        ArrayBlockingQueue<String> arrayBlockingQueue = new ArrayBlockingQueue<>(1);//可存放数量为1
        Cooker c =new Cooker(arrayBlockingQueue);
        Foodie f = new Foodie(arrayBlockingQueue);
        //启动线程
        c.start();
        f.start();
    }
}
